package com.hfb.mashibing.alip8.interview.j2se;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/** Q:分析线程池的实现原理和线程的调度过程
 * 1、
 *
 */
public class T04_ThreadPoolExecutor_process {

    public static void main(String[] args) {

        /**
         *      无界 内部使用 SynchronousQueue
         *      适用：处理大量、耗时少的任务
         */
        ExecutorService cachedThreadPool = Executors.newCachedThreadPool();
        /**
         *可重用固定线程数
         */
        ExecutorService fixedThreadPool = Executors.newFixedThreadPool(3);
        /**
         * 单线程线程池
         */
        ExecutorService singleThreadExecutor = Executors.newSingleThreadExecutor();
        /** 定时、周期性任务的线程池
         * DelayedWorkQueue
         */
        ExecutorService scheduledThreadPool = Executors.newScheduledThreadPool(3);


    }

}
